#include "agencyeventmgr.h"
#include "minutelisten.h"



AgencyEventMgr::AgencyEventMgr()
{
}
AgencyEventMgr::~AgencyEventMgr()
{
}

stAgencyEvent* AgencyEventMgr::Get(const std::uint32_t agency_id)
{
    auto it = m_agency_event_infos.find(agency_id);
    if (it != m_agency_event_infos.end())
    {   
        return &it->second;
    }
    return nullptr;
}

void AgencyEventMgr::Update(stAgencyEvent&& agencyevent)
{
    m_agency_event_infos[agencyevent.agency_id] = std::move(agencyevent);
}

bool AgencyEventMgr::CheckAgencyEventActive(stAgencyEvent* pAgencyevent)
{
    if (!pAgencyevent)
        return false;
    
    return pAgencyevent->state == 1;
}





